#include "dominion.h"
#include "rngs.h"
#include "dominion_helpers.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>

int main (int argc, char **argv)
{
	
	struct gameState *test = newGame();
	int player = 0;
	test->handCount[player] = 5;
	test->deckCount[player] = 10;
	test->playedCardCount = 0;
	int *bonus = 0;
	test->coins = 0;
	
	//test choice 1 = 1 for steward card
	//should add two cards to hand
	cardEffect(steward, 1, 0, 0, test, 0, bonus);
	if(test->handCount[player] == 6)
		{
			printf("Test passed.\n");
		}
	else
		printf("Test failed, Card Count: %d\n", test->handCount[player]);
	
	if(test->playedCardCount == 1)
		{
			printf("Test passed.\n");
		}
	else
		printf("Test failed, played cards: %d\n", test->playedCardCount);
		
	//test choice 1 = 1 with max hand
	test->handCount[player] = 500;
	cardEffect(steward, 1, 0, 0, test, 0, bonus);
	if(test->handCount[player] == 501)
		{
			printf("Added cards to a maxed out hand.\n");
		}
	else
		printf("Test passed, Card Count: %d\n", test->handCount[player]);
	
	if(test->playedCardCount == 2)
		{
			printf("Test passed.\n");
		}
	else
		printf("Test failed, played cards: %d\n", test->playedCardCount);
		
	
	
	//test choice 1 = 2
	//should add two coins to player
	cardEffect(steward, 2, 0, 0, test, 0, bonus);
	if(test->coins == 2)
		{
			printf("Test passed.\n");
		}
	else
		printf("Test failed, coin count: %d\n", test->coins);
	if(test->playedCardCount == 3)
		{
			printf("Test passed.\n");
		}
	else
		printf("Test failed, played cards: %d\n", test->playedCardCount);
		
	//test choice trash 2 cards
	test->hand[player][1] = smithy;
	test->hand[player][2] = curse;
	cardEffect(steward, 0, 2, 3, test, 0, bonus);
	
	if(test->hand[player][1] == smithy)
		{
			printf("Test failed. Card is still in same position.\n");
		}
	else
		printf("Test passed.\n");
		
	if(test->hand[player][2] == curse)
		{
			printf("Test failed. Card is still in same position.\n");
		}
	else
		printf("Test passed.\n");
		
	if(test->discardCount[player] == 2)
		{
			printf("Test passed\n.");
		}
	else
		printf("Test failed. Discard Count: %d.\n", test->discardCount[player]);
	if(test->playedCardCount == 4)
		{
			printf("Test passed.\n");
		}
	else
		printf("Test failed, played cards: %d\n", test->playedCardCount);
		
		
	return 0;


}